
@extends('common.header')

<!-- 1.添加meta csrf_token -->
<meta name="csrf-token" content="{{ csrf_token() }}">  
<script src=" {{ asset('/js/jquery-1.8.3.min.js') }} "></script>
<script type="text/javascript">
	
	<!-- 2.设置全局ajax选项 -->
	$.ajaxSetup({
		headers: {
			'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
		}
	});
	// 获取 token
	var _token = $('meta[name="csrf-token"]').attr('content');

</script>
<body>

<br/>
<br/>
<br/>
<br/>

<!-- 页面标记  -->
<h3 style="margin-left:10%;margin-bottom:20px;color:#32CD32;font-size:25px;" >		
	{{ $title or '' }}
</h3>


<div class="row" style="margin-bottom:100px;" >

	<div class="col-xs-6 col-md-2">
	</div>
	
	<div class="col-xs-12 col-sm-6 col-md-7" style="border:1px solid #D6D6D6;">
		
		<div style="width:100%;text-align:center;" >
			<b style="font-size:28px;" >{{ $recommend->home }}</b>&nbsp;&nbsp;&nbsp;
			<img src="{{ $recommend->home_pic }}" />&nbsp;&nbsp;&nbsp;
			<b style="font-size:30px;" >VS</b>&nbsp;&nbsp;&nbsp; 
			<img src="{{ $recommend->away_pic }}" />&nbsp;&nbsp;
			<b style="font-size:28px;" >{{ $recommend->away }}</b>
		</div>
		<div style="width:100%;text-align:center;" >
			<h1>{{ $recommend->match_date }}</h1>
		</div>
		
		<h3>主队指数：{{ $recommend->home_index }}</h3>
		<h3>客队指数{{ $recommend->away_index }}</h3>
		<h3>平指数{{ $recommend->p_index }}</h3>
		<br/>
		<br/>
		{!! $recommend->content !!}
		<br/><br/><br/>

		
		@if( $recommend->status == 2 || $recommend->status == 6 )
			<div  class="form-group" style="margin-top:1%;">
				<button style="width:300px;margin-left:35%;" class="btn btn-success" data-toggle="modal" data-target=".bs-example-modal-sm" onclick="upStatus( {{ $recommend->id }},3);" >
					审核通过
				</button>
			</div>
			<button  style="width:300px;margin-left:35%;margin-top:1%;" data-toggle="modal" data-target=".bs-example-modal-sm" class="btn btn-danger" onclick="upStatus({{ $recommend->id }},6)" >未通过</button>
			<a style="width:300px;margin-left:35%;margin-top:2%;margin-bottom:5%;" class="btn btn-danger"  href="javascript:history.back();" >返回</a>
		@elseif( $recommend->status == 3 )
			<div  class="form-group" style="margin-top:1%;">
				<button style="width:300px;margin-left:35%;" class="btn btn-success" disabled >
					已审核通过
				</button>
			</div>
			<a style="width:300px;margin-left:35%;margin-top:1%;margin-bottom:5%;" class="btn btn-danger"  href="javascript:history.back();" >返回</a>
		@elseif( $recommend->status == 4 )
			<div  class="form-group" style="margin-top:1%;">
				<button style="width:300px;margin-left:35%;" class="btn btn-success" disabled >
					已推荐
				</button>
			</div>
			<a style="width:300px;margin-left:35%;margin-top:1%;margin-bottom:5%;" class="btn btn-danger"  href="javascript:history.back();" >返回</a>
		@elseif( $recommend->status == 5 )
			<div  class="form-group" style="margin-top:1%;">
				<button style="width:300px;margin-left:35%;" class="btn btn-success"  disabled  >
					头条文章
				</button>
			</div>
			<a style="width:300px;margin-left:35%;margin-top:1%;margin-bottom:5%;" class="btn btn-danger"  href="javascript:history.back();" >返回</a>
		@else
		@endif
		
		
		
		
	

		
		<!-- 1.模态框 不要动 -->
		<div class="modal fade bs-example-modal-sm" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel">
			<div class="modal-dialog modal-sm" role="document" id='show_info'  style="margin-top:80px;margin-left:50%;color:white;font-size:20px;">
			</div>
		</div>
		
	</div>
	
	<div class="col-xs-6 col-md-1">
		
	</div>
	
</div>
	
	
	
	


<div id="news" newsid="{{ $news_info->id or '' }}" ></div>


<script type="text/javascript">
	
	// 执行 修改 文章状态 
	function upStatus( id,status )
	{
		if( confirm('你真的确定？') )
		{
			$.ajax({
				type:"post",
				url:"{{ url('/recommendupstatus/') }}"+'/'+id,
				data:{status:status,_token:_token},
				async:true,    					
				dataType:"json",
				success:function(back){
					// 2.模态框 不要动
					$('#show_info').html( '' );
					$('#show_info').html( back['show_info'] );
					setTimeout(function(){
						location.href="{{ url('/recommend') }}";
					}, 1000);  
					
				}
			});
		}else
		{
			location.reload();
		}
	}
	
</script>


</body>
@extends('common.footer')